home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / winterp-1.13 / examples / README < prev    next >
Encoding:
Text File  |  1991-10-06  |  16.1 KB  |  335 lines

  1. ; WINTERP Copyright 1989, 1990, 1991 Hewlett-Packard Company (by Niels Mayer).
  2. ; XLISP version 2.1, Copyright (c) 1989, by David Betz.
  3. ;
  4. ; Permission to use, copy, modify, distribute, and sell this software and its
  5. ; documentation for any purpose is hereby granted without fee, provided that
  6. ; the above copyright notice appear in all copies and that both that
  7. ; copyright notice and this permission notice appear in supporting
  8. ; documentation, and that the name of Hewlett-Packard and Niels Mayer not be
  9. ; used in advertising or publicity pertaining to distribution of the software
  10. ; without specific, written prior permission.  Hewlett-Packard and Niels Mayer
  11. ; makes no representations about the suitability of this software for any
  12. ; purpose.  It is provided "as is" without express or implied warranty.
  13.  
  14. The WINTERP examples directory contains example Winterp-Lisp code. Some of
  15. the files in this directory are complete applications, some are just test
  16. code, and some are "random" winterp-lisp forms that I ended up typing in
  17. the process of experimenting with Motif using WINTERP,
  18.  
  19. ==============================================================================
  20.  
  21. Applications & Utilities:
  22. ------------------------
  23.  
  24. * bitmap-br.lsp: loading this file defines function BROWSE-BITMAP-DIRECTORY.
  25.     Given a directory containing only X bitmap files, calling
  26.     function (BROWSE-BITMAP-DIRECTORY <bitmap_directory_path>)
  27.     will create a browser of the bitmaps in directory
  28.     <bitmap_directory_path>. Clicking on the bitmap image in the 
  29.     browser will set your root window background to the specified
  30.     bitmap.
  31.  
  32. * bitmap-br2.lsp: Similar to bitmap-br.lsp, except that simply loading this
  33.     file will bring up a browser of the bitmaps in directory
  34.     /usr/include/X11/bitmaps/*. Unlike bitmap-br.lsp, this file
  35.     contains comments on what is happening in this simple application..
  36.  
  37. * calculator.lsp: A simple calculator. The layout on this example leaves
  38.     much to be desired. Shows a use of widget subclassing.
  39.     Just load this file to bring up application.
  40.  
  41. * colorsetr.lsp: each time you load this file, it will bring up a window
  42.     containing a single slider for red, green, and blue colors. 
  43.     You can use the sliders to create a colors, then
  44.     click the button "Set Color On Selected Widget", followed by
  45.     clicking on the widget whose color you want to set. 
  46.     Once the color on a widget has been set, you may move the sliders
  47.     to change that color value without having to reselect the widget.
  48.     By bringing up multiple instances of the colorsetr.lsp application
  49.     you can set multiple color planes in other winterp widgets...
  50.     Note that this uses XM_GET_COLORS to generate top/bottom/shadow
  51.     colors based on the background color you've dialed in. Unless you
  52.     have a lot of planes on your display, this can cause you to run out
  53.     of colors quickly. Note that this works only on Motif 1.1.
  54.  
  55. * fake-app.lsp: Example application using XM_MAIN_WINDOW_WIDGET_CLASS +
  56.     XM_ROW_COLUMN_WIDGET_CLASS/:simple_menu_bar +
  57.     XM_ROW_COLUMN_WIDGET_CLASS/:simple_pulldown_menu
  58.     to create a window with a menubar and pulldowns, etc. Just load this
  59.     file to see the application. Note that this works on Motif 1.1 only.
  60.  
  61. * graphcalc.lsp: A calculator with "direct manipulation" graphic display of
  62.     previous results (a sort of graphical spreadsheet, perhaps). 
  63.     Users may also enter expressions in infix notation and these will
  64.     be displayed with disambiguation provided by precedence rules. To
  65.     run the calculator, just load this file.  NOTE: this file requires
  66.     version of WINTERP extended for HP's XmGraph widget (Motif 1.0
  67.     only) which allows you to lay out other Motif widgets in an
  68.     arbitrary directed graph with widgets connected by XmArg "gadgets".
  69.     Since most of you don't have the HP XmGraph widget, this
  70.     application is not very useful for you. However, this may serve as
  71.     an interesting example of the use/abuse of subclassed Motif widgets.
  72.     [graphcalc-options.lsp and graphcalc-options.lsp are application
  73.     options    that may be loaded separately from graphcalc.lsp.
  74.  
  75. * grep-br.lsp: A file-search browser application that uses the unix
  76.     grep(1) program to search through files. Type the 
  77.     string or regular expression for searching into the XmText widget
  78.     labeled "Search for string"; type the set of wildcarded set of
  79.     files into the XmText widget labeled "From Files". After clicking
  80.     on the "DO SEARCH" push-button. The matching lines output by grep
  81.     will appear in the XmList widget. Double clicking on a line in the 
  82.     XmList widget will display the file in the XmText view-area widget,
  83.     with the matching line at the top of the widget. In addition to
  84.     being a useful, yet simple, application, grep-br.lsp is also a
  85.     good example of subclassing Motif widgets inside WINTERP.
  86.  
  87. * helloworld.lsp: 10 lines of Winterp-Lisp code is all that is needed
  88.     to produce the canonical "Hello World" program in WINTERP.
  89.  
  90. * identifier.lsp: A useful UI debugging tool. Loading this file creates a
  91.     panel that allows you to click on a widget to identify it, click on
  92.     a widget to destroy it, or change the foreground and background
  93.     colors of the widget you click on. For Motif 1.1, the "Identify
  94.     Selected Widget" button becomes especially useful because it will
  95.     print out the widget's fully qualified resource name -- this allows
  96.     setting    up your X-resources on a per widget basis and allows you to
  97.     better understand which widgets are affected by a particular
  98.     setting in your ~/.Xdefaults...
  99.  
  100. * mail-br.lsp: Load this file to create a simple mail browser. 
  101.     This creates a browser of the last 30 MH messages in your
  102.     MH folder +inbox. This assumes that (1) you have MH, (2) you have
  103.     folder +inbox, (3) "scan" is on your $PATH. (4) various other
  104.     things I forgot...
  105.  
  106. * man-br.lsp: Load this file to create a simple manual page browser for
  107.     looking at formatted manual pages installed in
  108.     /usr/local/man/cat3/*.3X. I use this application to browse my Motif
  109.     manual pages, which are kept in that directory. To start WINTERP up
  110.     running man-br as a standalone application, do:
  111.     "winterp -init_file <path>/man-br.lsp -no_unix_server -no_init_msgs &"
  112.     where "<path>/man-br.lsp" is the full path to this file.
  113.         Assumptions:
  114.             (1) You have formatted manual pages for Motif
  115.                 in /usr/local/man/cat3/*.3X.
  116.             (2) $PAGER environment variable is set to a paging
  117.                 program such as "less" or "more".
  118.             (3) xterm(1) program is on your $PATH.
  119.         Hints:
  120.             The names of the Motif manual pages displayed in
  121.             the file-selection-box browser will be more
  122.             intuitive if you convert the manual page names to
  123.             long-filenames -- for details, see the
  124.             doc/build.doc script supplied with Motif 1.1.
  125.             (Within HP, you may pick up the longfilename
  126.             formatted manpages via anonymous ftp from
  127.             hplnpm.hpl.hp.com, directory pub,
  128.             file OSFMotif1.1.1-man-output.tar.Z)
  129.  
  130. * w_ctrlpnl.lsp: Loading this file creates a control panel for WINTERP,
  131.     including a rudimentary way to edit and send lisp to winterp's
  132.     xlisp evaluator without having to use the gnuemacs interface
  133.     (src-client/winterp.el) or src-client/wl.c. The following
  134.     user-interface actions are provided:
  135.         ** Double-Click file in file-selection-box puts file into
  136.            XmText widget for editing or viewing.
  137.         ** "Edit($EDITOR)": the selected file gets edited by the
  138.            editor set in environment variable $EDITOR. You may
  139.            override $EDITOR by setting Winterp-variable
  140.            *SYSTEM-EDITOR*.
  141.         ** "Load File": loads the selected file into WINTERP.
  142.         ** "Save File": this is a No-Op for now.
  143.         ** "Eval @ Point": evaluates the Winterp-Lisp expression
  144.            you've typed into the control-panel's XmText editor.
  145.            The cursor (point) must be WITHIN the expression's
  146.            parentheses in order for it to get evaluated. The
  147.            evaluated expression is highlighted in the XmText editor.
  148.            (This needs some fixing; If the cursor isn't at the
  149.            right place, you'll get an "error: index out of range".)
  150.         ** <- (left arrow): moves to front of the current
  151.            Lisp expression. Note that this function doesn't
  152.            quite work right (generates "error: index out of range"
  153.            if the cursor isn't at the right place).
  154.         ** -> (right arrow): moves to end of the current
  155.            Lisp expression. Note that this function doesn't
  156.            quite work right (generates "error: index out of range"
  157.            if the cursor isn't at the right place).
  158.         ** Debug (toggle): turns on/off entry into XLISP's
  159.            debugger when an error is signalled. For more
  160.            info, see XLISP variable *breakenable* in
  161.            ./../doc/xlisp.doc.
  162.         ** Trace (toggle): turns on/off printing of XLISP
  163.            backtrace when an error occurs and debugging is enabled.
  164.            For more info, see XLISP variable *tracenable* in
  165.            ./../doc/xlisp.doc.
  166.         ** GC Msgs (toggle): turns on/off printing of messages
  167.            when a garbage collection occurs. For more info, see
  168.            XLISP variable *gc-flag* in ./../doc/xlisp.doc.
  169.         ** Err-Cont: Invokes XLISP's '(continue)', which will
  170.            allow you to continue from a "continuable error"
  171.            if Debug is On.
  172.         ** Err-^Level: Invokes XLISP's '(clean-up)', which will
  173.            clean up from the current error, and pop you up one
  174.            level in the debugger's error stack.
  175.         ** Err-~Level: Invokes XLISP's '(top-level)', which will
  176.            clean up from the current error, and pop you back to
  177.            the top-level read/eval/print loop.
  178.  
  179. ==============================================================================
  180.  
  181. "Libraries:"
  182. -----------
  183.  
  184. * initialize.lsp: this file contains various XLISP definitions that are
  185.     essential for proper lisp usage. This file also contains various
  186.     personal customizations for WINTERP. You should do the following:
  187.     (1) copy this file to <homedir>/.winterp
  188.     (2) set resource "Winterp.lispInitFile: <homedir>/.winterp"
  189.     (3) Customize sections commented out at the end of this file.
  190.         * Uncomment "LOAD" statements
  191.         * Add XLISP globals that one wants customized.
  192.         * Load any other personal macros, etc.
  193.  
  194. * prov-req.lsp: a simple attempt at Common Lisp's provide/require
  195.     functionality. Note that this uses the X11r4 routine
  196.     XT_RESOLVE_PATHNAME (XtResolvePathname()), therefore you can only
  197.     use this w/ Motif 1.1. Use this library if you need a way of 
  198.     loading Winterp-Lisp files along a specified "search path".
  199.     See documentation in file for details.
  200.  
  201. ==============================================================================
  202.  
  203. WINTERP/Motif Tests & Examples:
  204. ------------------------------
  205.  
  206. * Command.lsp: demonstrate XM_COMMAND_WIDGET_CLASS methods and callbacks.
  207.     Just load this file to see widget.
  208.  
  209. * FileSB.lsp: demonstrate XM_FILE_SELECTION_BOX_WIDGET_CLASS methods and
  210.     callbacks. Just load this file to see widget.
  211.  
  212. * Form1.lsp: demonstrate simple use of XM_FORM_WIDGET_CLASS. 
  213.     This example is the same as formtest.c on p 88 of Doug Young's
  214.     Motif book. Just load this file to see example.
  215.  
  216. * Form2.lsp: demonstrate use of XM_FORM_WIDGET_CLASS using
  217.     :xmn_top_position and :xmn_bottom_position constraints. This is
  218.     similar to formtest.c on p 91-92 of Doug Young's Motif book.
  219.     Just load this file to see example.
  220.     
  221. * Form3.lsp: demonstrate more complicated use of XM_FORM_WIDGET_CLASS to
  222.     lay out a panel for our multimedia controller. Just load this file
  223.     to see example.
  224.  
  225. * List.lsp: demonstrate XM_LIST_WIDGET_CLASS methods and callbacks. Shows
  226.     off different selection modes available, and callback support
  227.     for the different modes. Just load this file to see example.
  228.  
  229. * RowColumn.lsp: demonstrate usage of Motif 1.1's XmCreateSimple*()
  230.     routines, namely XM_ROW_COLUMN_WIDGET_CLASS/:simple_radio_box
  231.     XM_ROW_COLUMN_WIDGET_CLASS/:simple_check_box
  232.     XM_ROW_COLUMN_WIDGET_CLASS/:simple_option_menu.
  233.     Just load this file to see examples. Note that 
  234.     XM_ROW_COLUMN_WIDGET_CLASS/:simple_option_menu invokes Motif 1.1's
  235.     popup-menu bug (see ./../doc/BUGS for details).
  236.  
  237. * SHELL.lsp: tests out the following classes and methods on those classes
  238.     OVERRIDE_SHELL_WIDGET_CLASS, TRANSIENT_SHELL_WIDGET_CLASS,
  239.     TOP_LEVEL_SHELL_WIDGET_CLASS, APPLICATION_SHELL_WIDGET_CLASS,
  240.     TOP_LEVEL_POPUP_SHELL_WIDGET_CLASS,
  241.     APPLICATION_POPUP_SHELL_WIDGET_CLASS,
  242.     OVERRIDE_POPUP_SHELL_WIDGET_CLASS,
  243.     TRANSIENT_POPUP_SHELL_WIDGET_CLASS,
  244.     XM_DIALOG_POPUP_SHELL_WIDGET_CLASS. Just load this file to see
  245.     examples.
  246.  
  247. * Scale.lsp: shows use of XM_SCALE_WIDGET_CLASS. Just load this file to see
  248.     example.
  249.  
  250. * SelectioB.lsp: tests XM_SELECTION_BOX_WIDGET_CLASS methods and callbacks.
  251.     Just load this file to see examples.
  252.  
  253. * Text.lsp: tests XM_TEXT_WIDGET_CLASS methods and callbacks. Also
  254.     demonstrates use of :CALL_ACTION_PROC to invoke a widget action
  255.     procedure programmatically. Just load this file to see examples.
  256.  
  257. * accel.lsp: Example of Xtoolkit accelerator usage via
  258.     method :INSTALL_ALL_ACCELERATORS. Load this file, and type letters
  259.     [a-z] into any pushbutton widget. each pushbutton widget
  260.     has a single accelerator, one of key [a-z]. Accelerators for
  261.     all other pushbuttons get installed onto each pushbutton... The
  262.     accelerator arms the pushbutton, and the pushbutton's arm
  263.     callback enters the typed character into the text widget.
  264.  
  265. * callbacks.lsp: Demonstrates using callbacks and timeouts. Just
  266.     load this file and click on the "start" or "stop" button...
  267.  
  268. * dialogshel.lsp: Demonstrates WINTERP's dialog shells, and what happens
  269.     when you manage/unmanage them. You may either load this file in
  270.     it's entirety, or interactively evaluate individual forms using
  271.     gnu-emacs or w_ctrlpnl.lsp.
  272.  
  273. * getvalues.lsp: a random test to see whether the code
  274.     in winterp/src-server/w_resources.c has any machine dependencies.
  275.     Load this file, and if your stdout beeps and you see messages
  276.     about "failed: ..." then please send the output to
  277.     mayer@hplabs.hp.com. NOTE: the actual graphical result of loading
  278.     this file is not pretty. In fact, it's not supposed to be pretty....
  279.  
  280. * hostlookup.lsp: A stupid example using X_REFRESH_DISPLAY to popup
  281.     and display contents of a "working dialog" before a time-consuming
  282.     subprocess begins to execute. Note that X_REFRESH_DISPLAY is only
  283.     defined on HPUX WINTERPs. You may be able to get this working for
  284.     your machine as well...    see
  285.     src-server/w_utils.c:Wut_Prim_X_REFRESH_DISPLAY() and
  286.     src-server/utils.c for details....
  287.     
  288. * interact.lsp: This file is not meant to be loaded. Rather, you should
  289.     interactively evaluate forms within the file while inside the
  290.     gnu-emacs editor. Basically, this file demos playing around with
  291.     some of WINTERP's interactive features using the GET_MOUSED_WIDGET
  292.     primitive.
  293.  
  294. * mng-test.lsp: this file tests out managing and unmanaging widget
  295.     arrays/lists. It is best used by interactively evaluating 
  296.     individual expressions (via the gnu-emacs interface), rather than
  297.     loading the entire file.
  298.  
  299. * pixmaps.lsp: Play around with pixmaps. These are just random individual
  300.     forms I eval'd to play around and test pixmaps, pixmap garbage
  301.     collection, image cacheing, etc. Many of the pixmaps mentioned in
  302.     this file do not exist on your machine. Also, this file assumes
  303.     that you've already loaded rc-shell.lsp.
  304.  
  305. * popen.lsp: examples of playing around with POPEN to collect data
  306.     from UNIX.
  307.  
  308. * popup-menu.lsp: POPUP menu example. This is a 1-to-1 translation of the
  309.     popup menu example in the Motif Programmer's Guide. Just 'load'
  310.     this file to see the example. Note that for Motif 1.1, this example
  311.     invokes window-manager "close" bug.  See ./../doc/BUGS for details.
  312.  
  313. * radiobox1.lsp: a straightforward example for creating a radio box. See
  314.     radiobox2.lsp for a better way using a WINTERP-subclassed
  315.     toggle-button. Just load this file to see the example.
  316.  
  317. * radiobox2.lsp: A better (?) way of creating a radio box, using
  318.     subclassing of togglebutton. Note that this version doesn't waste
  319.     as much memory as radiobox1.lsp because it defines a single
  320.     entry-callback on the rowcolumn widget instead of forcing each
  321.     toggle-button to have separate copies of very similar
  322.     callback-closures.  Just load this file to see the example.
  323.  
  324. * rc-shell.lsp: Load this file to put up a shell containing a row-column
  325.     manager. I use this as an experimentation area for playing around
  326.     with individual widgets.
  327.  
  328. * scooter.lsp: a silly example that scoots (moves) windows around the
  329.     screen while changing their colors. This can really tie up your
  330.     X server and window manager, so be careful...
  331.  
  332. * trans.lsp: Tests of Xt translation, accelerator facilities. Also test
  333.     winterp's "Lisp()" action, which allows you to call the lisp
  334.     evaluator from a translation/accelerator table.
  335.